package org.example;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import java.io.File;

@Mojo(name = "fileCount")
public class FileCountPlugin extends AbstractMojo {

    @Parameter(property = "fileDir")
    private String fileDir = "";

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        File dir = new File(fileDir);
        for (File file : dir.listFiles()) {
            System.out.println("fileName = " + file.getName());
        }
    }
}
